public class Test10 {
    public static void main(String[] args) {
        Print p1 = new Print();
        p1.setPriority(4);

        Print p2 = new Print();
        p2.setPriority(2);

        p1.start();
        p2.start();

    }
}

class Print extends Thread {
    public void run() {
        for (int i = 1; i <= 10000; i++) {
            System.out.println(Thread.currentThread().getName() + " " + i);
        }
    }
}
